class Solution:
    def plusOne(self, digits):
        """
        :type digits: List[int]
        :rtype: List[int]
        """
        res = []
        carry_bit = 1
        for v in reversed(digits):
            s = v + carry_bit
            res.insert(0, s % 10)
            carry_bit = s // 10

        if carry_bit > 0:
            res.insert(0, carry_bit)

        return res
        
s = Solution()
print('ss', s.plusOne([9]))
print('ss', s.plusOne([1,2,3]))
print('ss', s.plusOne([4,3,2,1]))
